package com.daokin.controller;

import com.daokin.constant.SystemConstant;
import com.daokin.dto.User;
import com.daokin.util.HttpUtils;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/")
public class BaseController {

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public void userLogin(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) {
        String basePath = HttpUtils.getBasePath(request);
        try {
            response.sendRedirect(basePath + "/daokin/wellcome.htm");
        } catch (IOException ex) {
            Logger.getLogger(BaseController.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

}
